﻿@{
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
}
    <form method="get" id="paintingform" action="/admin/painting/list" enctype="multipart/form-data"> 
        <label>油画标题</label>
        <input type="text" class="text-input small-input" value="@ViewBag.Keyword" name="keyword"/>
        <input type="submit" class="button" value="搜索"/>
    </form>
    <table>
    <thead>
        <tr>
            <th>ID</th>
            <th>
                Title
            </th>
            <th>
                操作
            </th>
        </tr>
    </thead>
    <tbody>
            @{
            int index = 0;
            foreach (dynamic painting in ViewBag.Paintings)
            {
                if (index % 2 == 0)
                {
            <tr>
                <td>@painting.PaintingNumber</td>
                <td>@painting.Title</td>
                <td>
                    <a href="/admin/painting/edit/@painting.PaintingId">编辑</a>
                </td>
            </tr>
               }
                else
                {
            <tr class="alt-row">
                <td>@painting.PaintingNumber</td>
                <td>@painting.Title</td>
                <td>
                    <a href="/admin/painting/edit/@painting.PaintingId">编辑</a>
                </td>
            </tr>
                }
                index++;
            }
        }
    </tbody>
</table>